Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: display skip reason in new ui #618

Merged
merged 2 commits into from
Nov 26, 2024
Merged

Conversation

shadowusr
Copy link
Member

What's done:

  • Skip reason is now displayed as part of preview in tree view in new ui
  • Skip reason is displayed in meta when possible

Demo report: https://nda.ya.ru/t/Ba_4zPC979ttwt

Copy link
Member

@DudaGod DudaGod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@@ -109,6 +110,23 @@ function MetaInfoInternal(props: MetaInfoInternalProps): ReactNode {
});
}

const shouldAddSkipReason = Boolean(!metaInfoItemsWithResolvedUrls.find(item => item.label === 'muteReason'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use a separate variable for this expression - Boolean(!metaInfoItemsWithResolvedUrls.find(item => item.label === 'muteReason')). For example - hasMuteReason

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this with sipayrt and decided that it's not very good idea to include such specific logic related to muteReason, so i got rid of altogether

content: reason.props.children,
url: reason.props.href
});
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can reason be something else? I mean is there a condition under which the value does not fall into any of the described conditions (if and else if).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is no longer here.

label: 'skipReason',
content: reason
});
} else if (!Array.isArray(reason) && typeof reason.props.children === 'string' && typeof reason.props.href === 'string') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason can be an array?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer here, got rid of parsing html entirely.

if (props.item.images?.length) {
if (props.item.skipReason) {
return <div className={styles.skipReasonContainer}>
<div className={styles.skipReason}>Skipped ⋅ {Parser(props.item.skipReason)}</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- why you choose a dot as a separator? But in IU it looks quite harmonious. Maybe you use it in some other components?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks nice as a separator and it's not the only place we use dot. The other places are hint toast, and other variants of subtitle in tree view.

@shadowusr shadowusr force-pushed the users/shadowusr/TESTPLANE-335 branch from 1018dba to dd1119d Compare November 26, 2024 16:42
@shadowusr shadowusr merged commit 35c39c5 into master Nov 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants